]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageList: stop syncing if closeButton has been destroyed
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 4 Jul 2018 13:56:25 +0000 (15:56 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 3 Sep 2018 22:43:21 +0000 (22:43 +0000)
The _sync function for Message only updates the close button visibility,
so we can safely stop doing that if the close button get get destroyed earlier
(as it happens when clicking on it).

https://bugzilla.gnome.org/show_bug.cgi?id=791233

js/ui/messageList.js

index 3b3c2b6dfa01aad326c985a80e4c438130dbae92..547135a1ffcb2fe3047a802e8e7df07bd699402e 100644 (file)
@@ -363,7 +363,8 @@ var Message = new Lang.Class({
         this.setBody(body);
 
         this._closeButton.connect('clicked', this.close.bind(this));
-        this.actor.connect('notify::hover', this._sync.bind(this));
+        let actorHoverId = this.actor.connect('notify::hover', this._sync.bind(this));
+        this._closeButton.connect('destroy', this.actor.disconnect.bind(this.actor, actorHoverId));
         this.actor.connect('clicked', this._onClicked.bind(this));
         this.actor.connect('destroy', this._onDestroy.bind(this));
         this._sync();